class PlcStates(object):

    def __init__(self):
        self.connectState = -1
        self.online = False
        self.rs = False
        self.run = "待机中"


class DeviceStates(object):
    def __init__(self):
        self.plcStates = PlcStates()
        self.cameraGroupStates = [False, False]
        self.workStopFlag = False
        self.plcAlarmInfo = ""
        self.plcAlarmInfoVisible = False

    def pack_state_to_dict(self):
        res = {
            "plcStates":
                {
                    "online": self.plcStates.online,
                    "rs": self.plcStates.rs,
                    "run": self.plcStates.run
                },
            "plcAlarmInfo": self.plcAlarmInfo,
            "plcAlarmInfoVisible": self.plcAlarmInfoVisible,
            "cameraGroupStates":self.cameraGroupStates
        }
        return res
